package com.wolfcode.service.impl;

import com.wolfcode.mapper.ProductMapper;
import com.wolfcode.pojo.Product;
import com.wolfcode.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yinyin
 * @create 2022/08/19 下午 8:34
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> findAll() {
       return productMapper.findAll();
    }

    @Override
    public Product findOne(Long id) {
        return productMapper.findOne(id);
    }

    @Override
    public void addProduct(Product product) {
         productMapper.addProduct(product);
    }

    @Override
    public void updateProduct(Product product) {
         productMapper.updateProduct(product);
    }

    @Override
    public void deleteProduct(Long id) {
         productMapper.deleteProduct(id);
    }
}
